<?php

/**
 * This is the model class for table "travel_agency".
 *
 * The followings are the available columns in table 'travel_agency':
 * @property integer $id ID
 * @property string $name 景区名
 * @property string $image 图片
 * @property integer $province 省
 * @property integer $city 市
 * @property integer $district 区
 * @property string $address 详细地址
 * @property string $desc 景区介绍
 */
class TravelAgency extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return TravelAgency the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.TravelAgencyMetadata';
	}
	
	public function __toString() {
		$enum = Yii::app()->enum;
		$name = '【'.$enum->lookup("district", $this->province) . " ".
		$enum->lookup("district", $this->city) . " ".
		$enum->lookup("district", $this->district).'】'.$this->name;
		return $name;
	}
}